# -*- coding:utf-8 -*-
__author__ = 'LangJin'
__date__ = "2022-1-13"
__doc__ = "响应体的封装"


def resultMsg(code=1,msg="操作成功",data=None,total=None):
    """
    @功能    :接口返回的数据进行封装
    @参数    :
    @返回值  :
    @时间    :2022/11/06 16:53:48
    @作者    :浪晋
    @版本    :1.0
    """
    if data == None and total == None:
        result = {'code':code,"message":msg}
    elif data != None and total == None:
        result = {'code':code,"message":msg,'data':data}
    else:
        result = {'code':code,"message":msg,'data':data,'total':total}
    return result